Checking if a POST[] variable is an IP address?

Posted by Rob on Stack Overflow See other posts from Stack Overflow or by Rob
Published on 2010-06-14T04:13:48Z Indexed on 2010/06/14 4:22 UTC
Read the original article Hit count: 158

Filed under:

I'm making a script, in which the user needs to enter a valid IP address. How can I check that it's a valid IP address? (Doesn't need to resolve)

Basically $_POST['ip'] just needs to be between 0.0.0.0 and 255.255.255.255

© Stack Overflow or respective owner

Related posts about php